<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateJrttEquipmentTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('jrtt_equipment', function (Blueprint $table) {
            $table->increments('id');
            $table->string("aid",50)->nullable()->comment("广告计划id");
            $table->string("aid_name",50)->nullable()->comment("广告计划名称");
            $table->string("campaign_id",50)->nullable()->comment("广告组id");
            $table->string("cid",50)->nullable()->comment("广告创意id");
            $table->string("csite",50)->nullable()->comment("广告投放位置");
            $table->string("ctype",50)->nullable()->comment("创意样式");
            $table->string("mac",50)->nullable()->comment("MAC地址");
            $table->string("mac1",50)->nullable()->comment("用户终端的eth0接口的MAC地址");
            $table->string("ua",50)->nullable()->comment("客户端上报数据时http的header中的user_agent");
            $table->string("idfa",50)->nullable()->comment("iOS IDFA适用ios6及以上系统");
            $table->string("imei",50)->nullable()->comment("用户终端的15位数字IMEI");
            $table->string("uuid",50)->nullable()->comment("用户终端的UUID（用户终端的15位数字IMEI）");
            $table->string("androidid",50)->nullable()->comment("手机android_id。该设备识别号可能为空，与设 备可能存在多对一或一对多的关系");
            $table->string("openudid",50)->nullable()->comment("OPENUDID（安卓和IOS手机均有）");
            $table->string("os",50)->nullable()->comment("客户端操作系统");
            $table->string("ip",50)->nullable()->comment("媒体投放系统获取的用户终端的公共IP地址");
            $table->string("ts",50)->nullable()->comment("客户端发生广告点击事件的时间");
            $table->string("convert_id",50)->nullable()->comment("转化id");
            $table->string("callback_url",255)->nullable()->comment("回调地址");
            $table->string("callback_param",50)->nullable()->comment("回调参数");
            $table->integer("is_match")->default(0)->comment("是否成功匹配");
            $table->dateTime("match_time")->nullable()->comment("匹配时间");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('jrtt_equipment');
    }
}
